import 'package:flutter/material.dart';

void main() => runApp(ButtonApp());

class ButtonApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter按钮示例',
      home: Scaffold(
        appBar: AppBar(title: Text('Flutter按钮示例')),
        body: SingleChildScrollView(
          padding: EdgeInsets.all(16),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                'ElevatedButton示例',
                style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
              ),
              ElevatedButton(child: Text("normal"), onPressed: () {}),
              SizedBox(height: 10),
              ElevatedButton.icon(
                icon: Icon(Icons.send),
                label: Text("发送"),
                onPressed: () {},
              ),
              SizedBox(height: 20),

              Text(
                'TextButton示例',
                style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
              ),
              TextButton(child: Text("normal"), onPressed: () {}),
              SizedBox(height: 10),
              TextButton.icon(
                icon: Icon(Icons.info),
                label: Text("详情"),
                onPressed: () {},
              ),
              SizedBox(height: 20),

              Text(
                'OutlinedButton示例',
                style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
              ),
              OutlinedButton(child: Text("normal"), onPressed: () {}),
              SizedBox(height: 10),
              OutlinedButton.icon(
                icon: Icon(Icons.add),
                label: Text("添加"),
                onPressed: () {},
              ),
              SizedBox(height: 20),

              Text(
                'IconButton示例',
                style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
              ),
              IconButton(icon: Icon(Icons.thumb_up), onPressed: () {}),
              SizedBox(height: 20),

              Text(
                '带图标的按钮示例',
                style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
              ),
              ElevatedButton(
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.blue,
                  foregroundColor: Colors.white,
                ),
                child: Row(
                  mainAxisSize: MainAxisSize.min,
                  children: [Icon(Icons.save), SizedBox(width: 5), Text("保存")],
                ),
                onPressed: () {},
              ),
            ],
          ),
        ),
      ),
    );
  }
}
